async function main() {
    console.log("进入合理化建议");
    let num = $this.model.table_1753963093163_sBIit.length;
    if (num > 0) {
        for (let i = 0; i < num; i++) {
            let id = $this.$util.uuid(); // 表单id
            let no = $this.$util.uuid(); // 表单no
            let headData = $this.model; // 表头数据
            let bodyData = $this.model.table_1753963093163_sBIit[i]; // 表体数据

            let tmpS = headData["select_1753962700860_jvWPZ"];
            let tmpS1 = ""
            switch (tmpS) {
                case '759df289d8650044fe21bd64d8ed5c67':
                    tmpS1 = "绩效面谈"
                    break;
                case 'cf7265915d7d33aabdf430d539531c57':
                    tmpS1 = "问卷"
                    break;
                case '7f6220c33073b1e99f78889613cbdaf4':
                    tmpS1 = "钉钉"
                    break;
                case 'e573262fa26e8d89260610127a5cf9a5':
                    tmpS1 = '访谈'
                    break;
                case 'd9f18b02fcd81c79fa4aaf5f8a26403c':
                    tmpS1 = '试用期考核'
                    break;
            }

            let tmpF = headData["select_1753962806627_LenG8"];
            let tmpF1 = ""
            switch (tmpF) {
                case '1cbd6a2739dff65bb5b90c076b47132a':
                    tmpF1 = "供应链类"
                    break;
                case 'c9209cea5cb338f497064059ffa19e29':
                    tmpF1 = "人事行政类"
                    break;
                case 'c8781d0b241345c3d12c066ec8b27438':
                    tmpF1 = "商务销售类及其他"
                    break;
                case '90feec93d071279ff7b32218d90b121b':
                    tmpF1 = "研发类"
                    break;
            }

            // let temp = "来源:"+tmpS1+
            //     ",分类"+tmpF1+
            //     ",建议事项:"+bodyData["body_1753963133305_u8VNc"]+
            //     ",计划改进措施:"+bodyData["body_1753963150009_WTWgA"]

            // 在每个部分之间添加换行符 \n
            let temp =
                `问题描述及改进措施：${bodyData["body_1760435419493_JF8Ew"] || ""}
            来源: ${tmpS1 || ""}
            分类: ${tmpF1 || ""}
            建议事项: ${bodyData["body_1753963133305_u8VNc"] || ""}
            备注: ${bodyData["body_1758953977101_bsKsZ"] || ""}
        `;

            let saveObj = {
                "bill_id": id,
                "create_user_id": headData.create_user_id,
                "create_user_name": headData.create_user_name,
                "create_dept_name": headData.create_dept_name,
                "bill_type": headData.bill_type,
                "create_dept_id": headData.create_dept_id,
                "bill_no": no,
                "create_company_name": headData.create_company_name,
                "create_date": headData.create_date,
                "create_company_id": headData.create_company_id,
                //系统字段
                "number_1711439316655_41L04": 0,//计划工时
                "number_1711439319768_Hzhsj": 0,//文档数量
                "systemSelect_1711504973428_U0If2": bodyData["body_1756195346779_f0Uyu"],//派发人 = 提出人
                "systemSelect_1711504973428_U0If2_ID": bodyData["body_1756195346779_f0Uyu_ID"],//派发人ID
                "number_1711505160101_Zy3nM": 0,//任务进度
                "number_1711505281945_eUZOr": 0,//里程碑序号
                "input_1711505283971_PgltR": "false",//里程碑
                "number_1711505313898_96ND4": "0",//任务累计工时
                "input_1711518795031_xvIfW": "1",//任务状态
                "systemSelect_1711520339026_rFF5K": headData.create_company,//派发部门
                "systemSelect_1711520339026_rFF5K_ID": headData.create_company_id,//派发部门id
                "select_1711505903223_YWk8w": "3a275c0eeea14665afce10787a8c42df",//合理化建议
                "input_1751171983502_E4gXx": 0,//计划项目编号
                //新建任务 - 研发评审遗留【项目编号】
                // "input_1718345101976_ZNGth": headData.input_1755331102220_F5VO6,//项目编号
                // "selectStr_1718345029613_IWjr8": 0,//选择项目立项
                // "selectStr_1718345029613_IWjr8_ID":0,//选择项目立项ID
                // "input_1718345101976_PBcTl":  headData.input_1753959378361_PtiNV,//项目名称
                "input_1711439260720_6QPqX": bodyData["body_1753963133305_u8VNc"],//任务名称
                "rangePicker_1711439307444_Ftzhm": [headData["datepicker_1753962927660_h759l"].format("YYYY-MM-DD HH:mm:ss"), bodyData["body_1753963216753_zyRba"].format("YYYY-MM-DD HH:mm:ss")],
                "systemSelect_1711439400905_v5lzI": bodyData["body_1756195344484_mJJ4f"],//审核人
                "systemSelect_1711439400905_v5lzI_ID": bodyData["body_1756195344484_mJJ4f_ID"],//审核人ID
                "systemSelect_1711439399614_qXQ72": bodyData["body_1756195342059_k6s9D"],//负责人ID//表体的负责人就是任务里面的负责人
                "systemSelect_1711439399614_qXQ72_ID": bodyData["body_1756195342059_k6s9D_ID"],//负责人ID
                "input_1711520372633_i4sGc": headData.create_date,//派发时间
                "textarea_1755766219698_SuIuk": temp,
                "input_1755832925036_EOoby": bodyData["body_id"],//合理化建议ID
                "status":2
            }

            let formDataH = new FormData()
            formDataH.append("billId", headData.bill_id); //【注：表头id】
            const isRes = await $this.$http.post("/formsBusiness/gettnrwfenpeiStatus/", formDataH)
            if (isRes.data.code === 280 && isRes.data.data === 2) {
                let files = []
                let formData = new FormData()
                formData.append('obj', JSON.stringify(saveObj))
                formData.append("files", JSON.stringify(files))
                if (bodyData.body_1753963480864_zFlJi !== "d8d1130d1b3d779271f6e27986732b1a") {
                    $this.$http.post("/wind/form/save/" + "task" + "/" + "add", formData).then(res => {
                        let data=res.data.data

                        //钉钉消息推送【字段不是必填项】
                        let urlDing = $this.$util.getAPI_URL();
                        let formDataDing = new FormData();
                        formDataDing.append("userIds", bodyData["body_1756195342059_k6s9D_ID"]);//执行人Id 字符串','拼接
                        formDataDing.append("taskName", bodyData["body_1753963133305_u8VNc"]);//任务名称
                        formDataDing.append("distributor", bodyData["body_1756195346779_f0Uyu"]);//派发人
                        formDataDing.append("planDate", [headData["datepicker_1753962927660_h759l"].format("YYYY-MM-DD HH:mm:ss"), bodyData["body_1753963216753_zyRba"].format("YYYY-MM-DD HH:mm:ss")]);//任务计划时间
                        urlDing = urlDing.replace("api", "task/dingMessagePush");
                        $this.$http.post(urlDing, formDataDing).then((res) => {
                            if (res.data.code === 280) {
                                $this.$message.success("钉钉消息推送成功")
                            } else {
                                $this.$message.errr("系统错误，请联系管理员!!!");
                            }
                        })

                        console.log(data)
                    }).catch(e => {
                        $this.$message.error(e.message);
                    });
                }
            }
        }
    }

}

main()